package com.activiti6.demo.stress;

import com.activiti6.demo.Activiti6DemoApplication;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.runtime.ProcessInstance;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.time.LocalTime;

@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Activiti6DemoApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class PrintServiceTest {

    @Autowired
    RuntimeService runtimeService;

    @Test
    public void testPrint() {
        System.out.println();
        System.out.println(LocalTime.now() + " 开始测试.");
        ProcessInstance pi = runtimeService.startProcessInstanceByKey("stressProcess");
        System.out.println(LocalTime.now() + " 测试结束。");
        System.out.println();
    }


}
